<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:c="http://java.sun.com/jstl/core"
	xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" 
	xmlns:h="http://java.sun.com/jsf/html" xmlns:t="http://myfaces.apache.org/tomahawk">
<body>      

<ui:composition template="/WEB-INF/templates/site.xhtml">

<ui:define name="pageTitle">
	#{messages['projectList.title']}
</ui:define>

<ui:define name="content">
	<h:form id="editProject">
		<h:commandButton value="Add Project" action="add" id="add" immediate="true" styleClass="button"/>
		
		<!-- Error from this table is caused by http://issues.apache.org/jira/browse/TOMAHAWK-466 -->
		<t:dataTable id="projects" var="project" style="margin-top: 10px"
		    value="#{projectList.projects}" rows="25" sortColumn="#{projectList.sortColumn}"
		    sortAscending="#{projectList.ascending}" styleClass="scrollerTable table"
		    headerClass="standardTable_Header" rowClasses="standardTable_Row1,standardTable_Row2"
		    columnClasses="standardTable_Column,standardTable_Column,standardTable_Column,standardTable_Column,standardTable_ColumnCentered">
		    <t:column>
		        <f:facet name="header">
		            <t:commandSortHeader columnName="id" arrow="true">
		                <h:outputText value="#{messages['project.id']}"/>
		            </t:commandSortHeader>
		        </f:facet>
		        <h:commandLink action="#{projectForm.edit}" value="#{project.id}">
		            <f:param name="id" value="#{project.id}"/>
		        </h:commandLink>
		    </t:column>
		    <t:column>
		        <f:facet name="header">
		            <t:commandSortHeader columnName="name" arrow="true">
		                <h:outputText value="#{messages['project.name']}"/>
		            </t:commandSortHeader>
		        </f:facet>
		        <h:outputText value="#{project.name}"/>
		    </t:column>
		</t:dataTable>
		
		<ui:include src="/WEB-INF/content/table/tableFooter.xhtml">
		    <ui:param name="tableName" value="projects"/>
		</ui:include>
		
		<script type="text/javascript">
		    highlightTableRows("editProject:projects");
		</script>
	
	</h:form>

</ui:define>

</ui:composition>

</body>
</html>
